from django.dispatch import dispatcher
from django.db.models import signals

try:
    from notification import models as notification

    def create_notice_types(app, created_models, verbosity, **kwargs):
        notification.create_notice_type("article_edited",
                                        "Article Edited",
                                        "your article has been edited")
        notification.create_notice_type("revision_reverted",
                                        "Article Revision Reverted",
                                        "your revision has been reverted")

    dispatcher.connect(create_notice_types,
                       signal=signals.post_syncdb,
                       sender=notification)
except ImportError:
    print "Skipping creation of NoticeTypes as notification app not found"
